home *** CD-ROM | disk | FTP | other *** search
/ AmigActive 22 / AACD 22.iso / AACD / Programming / RxMUI / Examples / ta.rexx < prev    next >
Encoding:
OS/2 REXX Batch file  |  2001-05-24  |  2.9 KB  |  106 lines

  1. /**/
  2.  
  3. signal on halt
  4. signal on break_c
  5.  
  6. call Init()
  7. call CreateApp()
  8. call HandleApp()
  9. /* never reached */
  10. /***********************************************************************/
  11. Init: procedure expose global.
  12.     l="rmh.library";if ~show("L",l) then;if ~addlib(l,0,-30) then exit
  13.     if AddLibrary("rxmui.library")~=0 then exit
  14.     call RxMUIOpt("DebugMode ShowErr")
  15.     if ~ReadArgs("FILE") then do
  16.         call PrintFault()
  17.         exit
  18.     end
  19.     if parm.0.flag then global.file=parm.0.value
  20.     else global.file=""
  21.     return
  22. /***********************************************************************/
  23. CreateApp: procedure expose global.
  24.  
  25.     app.Title="TransferAnim"
  26.     app.Version="$VER: TransferAnim 1.0 (12.10.2000)"
  27.     app.Copyright="©2000, alfie"
  28.     app.Author="alfie"
  29.     app.Description="TransferAnim Example"
  30.     app.Base="RXMUIEXAMPLE"
  31.     app.SubWindow="win"
  32.      win.ID="MAIN"
  33.      win.Title="TransferAnim"
  34.      win.Contents="mgroup"
  35.  
  36.       mgroup.0="gg"
  37.        gg.class="group"
  38.        gg.horiz=1
  39.         gg.0=hspace()
  40.         gg.1="ta"
  41.          ta.class="TransferAnim"
  42.          if global.file="" then ta.TABoingBall=1
  43.          else ta.TAfile=global.file
  44.          ta.Frame="ReadList"
  45.         gg.2=hspace()
  46.  
  47.       mgroup.1=MakeObj(,"HBar")
  48.  
  49.       mgroup.2="sg"
  50.        sg.class="group"
  51.        sg.columns=2
  52.         sg.0=Label("Frame")
  53.         sg.1="sl"
  54.          sl.class="slider"
  55.  
  56.       mgroup.3="cg"
  57.        cg.class="group"
  58.        cg.PageMode=1
  59.         cg.0=button("stop","_Stop")
  60.         cg.1=button("start","_Start")
  61.  
  62.     res=NewObj("APPLICATION","APP")
  63.     if res~=0 then exit
  64.  
  65.     call Notify("win","CloseRequest",1,"app","ReturnID","quit")
  66.  
  67.     call Notify("ta","pressed",0,"app","return","say 'ta pressed'")
  68.     call Notify("ta","taerror","everytime","app","return","say Error")
  69.     call Notify("ta","taframe","everytime","sl","set","value","triggervalue")
  70.  
  71.     call Notify("sl","value","everytime","ta","set","taframe","triggervalue")
  72.  
  73.     call Notify("start","pressed",0,"ta","start")
  74.     call Notify("stop","pressed",0,"ta","stop")
  75.     call Notify("start","pressed",0,"cg","set","ActivePage",0)
  76.     call Notify("stop","pressed",0,"cg","set","ActivePage",1)
  77.  
  78.     call set("win","open",1)
  79.     call getattr("win","open","o")
  80.     if o=0 then do
  81.         say "can't open window"
  82.         exit
  83.     end
  84.  
  85.     call getattr("ta","taframes","a")
  86.     call set("sl","max",a)
  87.  
  88.     return
  89. /***********************************************************************/
  90. HandleApp: procedure expose global.
  91.     ctrl_c=2**12
  92.     do forever
  93.         call NewHandle("app","h",ctrl_c)
  94.         if and(h.signals,ctrl_c)>0 then exit
  95.         select
  96.             when h.event="QUIT" then exit
  97.             otherwise interpret h.event
  98.         end
  99.     end
  100.     /* never reached */
  101. /***********************************************************************/
  102. halt:
  103. break_c:
  104.     exit
  105. /**************************************************************************/
  106.